home *** CD-ROM | disk | FTP | other *** search
- /*
-
-
- TestEval- a very simple shell to see if the evaluate library works
-
-
- */
-
-
- #include "Evaluate.h"
- #include "Sane.h"
- #include "stdio.h"
-
- main()
- {
- extended x;
- Str255 expr = "\psin(2*x)/x";
- OSErr theErr;
- decform format;
-
- printf("Expression: %#s\n",expr);
-
- x = 2.0;
-
- theErr = Evaluate(&expr,&x);
-
- if (theErr)
- {
- SysBeep(1);
- NumToString(theErr,&expr);
- printf("Error %#s\n",expr);
- }
- else
- {
- format.style = FIXEDDECIMAL;
- format.digits = 8;
-
- num2str(&format,x,&expr);
- printf("%#s\n",expr);
- }
- }